package com.lianzheng.dao.impl;

import java.util.List;
import java.util.Map;
import java.util.HashMap;

import com.lianzheng.dao.TbDocVideoaudiodetailinfoDAO;
import com.lianzheng.model.TbDocVideoaudiodetailinfo;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.orm.ObjectRetrievalFailureException;
import org.springframework.stereotype.Repository;


/**
 * This class interacts with Spring's IbatisTemplate to save/delete
 * <p>
 * <a href="TbDocVideoaudiodetailinfo.DAOimpl.java.html"><i>View Source</i></a>
 * </p>
 *
 * @author <a href="mailto:heymanchen@gmail.com">haihua chen</a>
*/
@Repository
public class TbDocVideoaudiodetailinfoDAOimpl extends SqlMapClientDaoSupport implements TbDocVideoaudiodetailinfoDAO {

    /**
     * @see com.lianzheng.dao.TbDocVideoaudiodetailinfoDAO#getTbDocVideoaudiodetailinfo($keytype)
     */

    public TbDocVideoaudiodetailinfo getTbDocVideoaudiodetailinfo(String detailid){
        return (TbDocVideoaudiodetailinfo)getSqlMapClientTemplate().queryForObject("getTbDocVideoaudiodetailinfo", detailid);
    }

    public TbDocVideoaudiodetailinfo getTbDocVideoaudiodetailinfoFull(String detailid){
        return (TbDocVideoaudiodetailinfo)getSqlMapClientTemplate().queryForObject("getTbDocVideoaudiodetailinfoFull", detailid);
    }

    public void addTbDocVideoaudiodetailinfo(final TbDocVideoaudiodetailinfo tbDocVideoaudiodetailinfo) {
        getSqlMapClientTemplate().update("addTbDocVideoaudiodetailinfo", tbDocVideoaudiodetailinfo);
    }

    public void updateTbDocVideoaudiodetailinfo(final TbDocVideoaudiodetailinfo tbDocVideoaudiodetailinfo) {
    getSqlMapClientTemplate().update("updateTbDocVideoaudiodetailinfo", tbDocVideoaudiodetailinfo);
    }

    public void removeTbDocVideoaudiodetailinfo(String detailid){
        getSqlMapClientTemplate().update("removeTbDocVideoaudiodetailinfo", detailid);
    }

    public List getTbDocVideoaudiodetailinfos() {
        return getSqlMapClientTemplate().queryForList("getTbDocVideoaudiodetailinfos",null);
    }

    public List getTbDocVideoaudiodetailinfoByAnd(final TbDocVideoaudiodetailinfo tbDocVideoaudiodetailinfo,String order_by){
        Map map = new HashMap();
        map.put(FIND_BY_AND, "True");
        if (order_by != null)
            map.put(ORDER_BY,order_by);
        tbDocVideoaudiodetailinfo.setMagic(map);
        return getSqlMapClientTemplate().queryForList("getTbDocVideoaudiodetailinfoByMap", tbDocVideoaudiodetailinfo);
    }

    public List getTbDocVideoaudiodetailinfoByOr(final TbDocVideoaudiodetailinfo tbDocVideoaudiodetailinfo,String order_by){
        Map map = new HashMap();
        map.put(FIND_BY_OR, "True");
        if (order_by != null)
            map.put(ORDER_BY,order_by);
        tbDocVideoaudiodetailinfo.setMagic(map);
        return getSqlMapClientTemplate().queryForList("getTbDocVideoaudiodetailinfoByMap", tbDocVideoaudiodetailinfo);
    }
    
    public List getTbDocVideoaudiodetailinfoByLike(final TbDocVideoaudiodetailinfo tbDocVideoaudiodetailinfo,String order_by){
        Map map = new HashMap();
        map.put(FIND_BY_LIKE, "True");
        if (order_by != null)
            map.put(ORDER_BY,order_by);
        tbDocVideoaudiodetailinfo.setMagic(map);
        return getSqlMapClientTemplate().queryForList("getTbDocVideoaudiodetailinfoByMap", tbDocVideoaudiodetailinfo);
    }
}